package org.spbsu.apco.server.utility;

import org.spbsu.apco.server.system.Node;
import org.spbsu.apco.server.system.Runner;

import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

@XmlRootElement(name = "List")
@XmlSeeAlso({Node.class, Runner.class})
public class JaxbList<T> {
    protected List<T> list;

    @Deprecated
    public JaxbList() {
    }

    public JaxbList(Collection<T> list) {
        this.list = new ArrayList<T>(list);
    }

    @XmlElementWrapper(name = "Items")
    public List<T> getList() {
        return list;
    }
}